import request from '@/utils/request'

// export function getRoutes() {
//   return request({
//     url: '/routes',
//     method: 'get'
//   })
// }

export function fetchRoles(params) {
  return request({
    url: '/api/v1/roles',
    method: 'get',
    params
  })
}

export function getRole(id) {
  return request({
    url: `/api/v1/roles/${id}`,
    method: 'get'
  })
}

export function addRole(data) {
  return request({
    url: '/api/v1/roles',
    method: 'post',
    data
  })
}

export function updateRole(id, data) {
  return request({
    url: `/api/v1/roles/${id}`,
    method: 'put',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/api/v1/roles/${id}`,
    method: 'delete'
  })
}
